An XML schema in an XML-type database defines the structure of instance XML documents inserted into a database. Instance XML documents are XML documents inserted into the XML-type database that conform to the XML schema. In an object-relational database system, the XML schema is used to determine the in-memory layout of the instance XML documents, as well as the database structures of the database representation in which XML documents are stored in the database system.
The database structures of a database representation of an XML schema are referred to herein as “base database structures.” Base database structures include, for example, table columns that each represent an element of an XML schema or object type tables whose object type attributes correspond to elements of the XML schema.
The in-memory layout of the instance XML documents is based in large part on the individual elements and attributes defined by the XML schema. However, an instance XML document does not need to be stored object-relationally on disk for it to have an XML schema-based in-memory layout. For example, an instance XML document may be stored on disk in a CLOB (Character Large Object), and yet its in-memory layout is still determined by the XML schema.
Once XML documents are stored in a database, a client application can perform queries on the database based on elements and attributes of the schema. Suppose, however, that the client application accessing the database changes. Often a change to a client application entails changes to an XML schema and its associated base database structures to maintain compatibility with the client application as changed. The procedure for making such changes to an XML schema and its associated base database structures is called schema evolution. One approach for performing schema evolution is copy-based evolution.
Copy-based evolution is a resource intensive technique that backs up all the data stored in tables associated with the evolving XML schema, deletes the old version of the XML schema (which deletes its associated base database structures), registers the new version of the XML schema (which creates new base database structures), and re-inserts the backed up data into the newly created structures. As part of re-inserting the backed up data into the new base database structures, the database system may apply a transformation on the data (e.g., in the form of an XSLT) to conform the data (e.g., XML documents) to the new version of the XML schema.
Although, copy-based evolution can update an XML schema, there are problems with its approach. For instance, copy-based evolution requires the database system to back up, transform, and restore the entire set of XML documents associated with an XML schema (e.g., both conforming and non-conforming XML documents) even though the change to the XML schema may be minimal or only affect a few documents. As a result, in large database systems, copy-based evolution may necessitate long downtimes.
In addition, there are some situations in which XML documents may be transformed during the copy-based evolution to conform the documents to the new version of the XML schema. Transforming XML documents is a time-consuming process. The reason the transformation process is time-consuming is that it involves copying each XML document in its entirety (instead of just those portions of the document that are affected by the XML schema changes) into memory before inserting new information into the document. Moreover, once the transformation is complete, the transformed document is copied as a whole back into the updated database.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.